<?php

namespace App\Http\Requests\V3_2_7;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class AlbumImgTitleRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'album_img'=>'required',
            'album_id'=>'required|integer',
            'flag'=>['required',Rule::in(['img','text','goods'])],
        ];
    }

    /**
     * 验证错误信息.
     *
     * @return array
     */
    public function messages(): array
    {
        return [
            'album_img.required' => '画册图片链接，不能为空！',
            'id.required' => '画册主键必传！',
            'id.integer' => '画册主键为整数！',
            'flag.required' => '类型参数，必传！',
            'flag.in' => '类型参数错误！',
        ];
    }
}
